package com.zrsx.managemodel.mapper;

import org.apache.ibatis.annotations.*;
import org.zachary.commonmodule.entity.entity.CreditDimension;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface CreditDimensionMapper {

    void updateCredit(CreditDimension creditDimension);

    @Delete("delete from credit_score_dimension where user_id = #{userId}")
    void deleteCredit(Integer userId);


    void batchInsertCredit(List<CreditDimension> creditDimensions);

    // 查询在指定时间范围内的“总信用分”维度记录
    List<CreditDimension> selectByDimensionTypeAndUpdateTime(
            @Param("dimensionType") String dimensionType,
            @Param("start") LocalDateTime start,
            @Param("end") LocalDateTime end
    );

    // 更新某用户某维度某分数的维度描述（不更新更新时间）
    int updateDimensionDesc(
            @Param("userId") Integer userId,
            @Param("dimensionType") String dimensionType,
            @Param("dimensionScore") Integer dimensionScore,
            @Param("dimensionDesc") String dimensionDesc
    );
}
